<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ include file="/WEB-INF/component/commonTagLib.jsp"%>
<!DOCTYPE html>
<html>
<head>
    <title><spring:message code="message.listForm.yiLiaoJiGou"/><spring:message code="message.jieSuan.jieSuanDan"/><spring:message code="message.jqGrid.cz.audit"/></title>
    <%@ include file="/WEB-INF/component/commonCSS.jsp"%>
    <style type="text/css">
        div.group-info {
            margin-top: 10px !important;
            margin-bottom: 0px !important;
        }
        input.innerInput {
            width: 98%;
        }
    </style>
</head>
<body class="skin-blue sidebar-mini fixed skin-blue-light-frame">
    <section class="content-header">
        <h1><spring:message code="message.listForm.yiLiaoJiGou"/><spring:message code="message.jieSuan.jieSuanDan"/><spring:message code="message.jqGrid.cz.audit"/></h1>
         <ol class="breadcrumb">
            <li><a href="${ctx}/home.jsp"><i class="fa fa-home"></i><spring:message code="message.lable.first"/></a></li>
            <li class="active"><a href="#"><spring:message code="message.jieSuan.jieSuanDan"/><spring:message code="message.jieSuan.guanLi"/></a></li>
            <li class="active"><a href="#"><spring:message code="message.listForm.yiLiaoJiGou"/><spring:message code="message.jieSuan.jieSuanDan"/><spring:message code="message.jieSuan.guanLi"/></a></li>
            <li class="active"><a href="#"><spring:message code="message.listForm.yiLiaoJiGou"/><spring:message code="message.jieSuan.jieSuanDan"/><spring:message code="message.jqGrid.cz.audit"/></a></li>
        </ol>
     </section>
     
   
    
    
    <section class="content">
        <div class=" box box-success">
            <div class="box-body">
                <div class=" form-inline">
        
			       <div class="form-group form-group-xs">
			            <spring:message code="message.jieSuan.tiJiaoRiQi"/><spring:message code="message.yanZheng.maoHao"/> 
				       <input class="form-control" type="text" id="beginDate"  name="beginDate" data-provide="datepicker" data-date-fmt="yyyy-MM-dd" placeholder="yyyy-MM-dd" />
				       -
				       <input class="form-control" type="text" id="endDate"  name="endDate" data-provide="datepicker" data-date-fmt="yyyy-MM-dd" placeholder="yyyy-MM-dd" />
			       </div>
                   <button id="selectWSJ" type="button" onclick="gridSerch();" class="btn btn-success btn-sm"><spring:message code="message.button.seachSpacing"/></button>
                    
                </div>
            </div>
        </div>
        
        <table class="jqgrid" id="gridlist"></table>
		<div id="gridpage"></div>
		
   </section> 
    
   <%@ include file="/WEB-INF/component/commonJS.jsp"%>
   <script type="text/javascript">
   
   //绑定回车
   $('#beginDate,#endDate').bind('keydown', function(event) {
       if (event.keyCode == "13") {        //13 位电脑上回车键的位置代码
           $('#selectWSJ').click();
       }
   }); 
 
 //  $("#indiName").focus();//加载页面光标在第一个查询框内
   
		 $(function() {
			 
			 
			 jQuery("#gridlist").jqGrid({
	    			url: "${ctx}/settlementFirst/getAuditFirstOneDataList.html", 
	    		    mtype: "POST",
	    			datatype: "json",
	    			autowidth: true,
	    			//shrinkToFit: false,
	    			height: 355,
	    			colNames : [
	    			            '<spring:message code="message.jqGrid.cz"/>',
                                '<spring:message code="message.jieSuan.jieSuanDan"/>id',
                                '<spring:message code="message.jieSuan.jieSuanDan"/><spring:message code="message.yanZheng.bianMa"/>',
                                '<spring:message code="message.jieSuan.jieSuanDan"/><spring:message code="message.listForm.mingCheng"/>',
                                '<spring:message code="message.listForm.yiLiaoJiGouBianMa"/>',
                                '<spring:message code="message.listForm.yiLiaoJiGouMingCheng"/>',
                                '<spring:message code="message.listForm.suoShuDiQu"/>',
                                '<spring:message code="message.jieSuan.zongTiaoMuShu"/>',
                                '<spring:message code="message.jieSuan.zongJinE"/>',
                                '<spring:message code="message.jieSuan.tiJiaoRen"/>',
                                '<spring:message code="message.jieSuan.tiJiaoShiJian"/>'
	    			            ],
					colModel : [
                            { name: 'oper', width:150, align:"center", sortable:false,
	                             formatter : function(val, opts, rowdata) {
	                             var str = "";
	                             str += "<a href='${ctx}/settlementFirst/toCenterAuditFirstOne.html?settlementId="+rowdata.settlementId+"'><spring:message code="message.jqGrid.cz.audit"/></a>"
	                             return str;
                            }  },
							{name : 'settlementId', hidden : true,width : 160,align : "center",sortable:false},
							{name : 'settlementCode', width : 160,align : "center",sortable:false},
							{name : 'settlementName', width : 160,align : "center",sortable:false},
							{ name: 'hospCode', width:80, align:"center", sortable:false},
		    		   		{ name: 'hospName', width:80, align:"center", sortable:false},
		    		   		{ name: 'areaName', width:80, align:"center", sortable:false},
							{name : 'totalOrders', width : 100,align : "center",sortable:false},
							{name : 'totalAmount', width : 100,align : "center",sortable:false,
								formatter : function(val, opts, rowdata) {
									return formatAmount(val, opts, rowdata);
								} 
							},
							{name : 'submitUser', width : 160,align : "center",sortable:false},									
                            {name : 'submitDatetime', width : 160,align : "center",sortable:false}
							
					],
	    				
	    				
	    			 rowNum: 20,
	    		     rowList: [10, 20, 50, 100],
	    		     rownumbers: true,
	    		     pager: "#gridpage",
	    		     viewrecords: true,
	    		     multiselect: false, 
	    		     caption: "<spring:message code="message.jqGrid.cz.audit"/><spring:message code="message.listForm.lieBiao"/>",
	    		   //序号宽度自动变化
	                 gridComplete:function(){
	                     //序号列宽度自适应（参数为jqgridID）
	                     autoRNWidth("gridlist");
	                     //数据只有一条时默认选中（参数为jqgridID）
	                     selectByOneData("gridlist");
	                 },
	    		     jsonReader: {
	    		         repeatitems: false,
	    		         id: "ids"
	    		     }
	    		});
	            
	            $("#gridlist").jqGrid('navGrid', '#gridpage', { add: false, edit: false, del: false, search: false, refresh: false });
	            
	            $(window).trigger("resize");
	            
	        });
			   
		   //查询
		   function gridSerch() {
			    var beginDate = $.trim($("#beginDate").val());
	        	var endDate = $.trim($("#endDate").val());
	        	var status = $.trim($("#status").val());
	    		$("#gridlist").jqGrid('setGridParam',{  
	    	        datatype:'json',
	    	        postData:{
	    	        		"beginDate":beginDate,
	    	        		"endDate":endDate,
	    	        		"status":status},
	    	        		page:1
	    	    }).trigger("reloadGrid"); //重新载入  
	    	}
		 //删除
	     /*    function removeDel(){
	  		    var rowIds = $("#gridlist").jqGrid("getGridParam", "selarrrow") || [];
	  			if (rowIds.length <= 0) {
	  				$.HN.message.alert("请选择要刪除的结算单！", "消息", "error");
	  				return;
	  			}
	  			var list = [];
	  			for (var i=0; i<rowIds.length; i++) {
	  				rowId = rowIds[i];
	  				var rowdata = $("#gridlist").jqGrid('getRowData', rowId);
	  				list.push({"settlementId":rowdata.settlementId});
	  			}
	  			$.post("${ctx}/settlementFirst/deleteSetSettlementFirstDetail.html?settlementId=${param.settlementId}", {
	  				"array" : json.jsonToString(list)
	  				}, function(result) {
	  					if (result.success) {
	  						$.HN.message.alert("刪除成功！", "消息", "success");
	  						gridSerch();
	  					} else {
	  						$.HN.message.alert("操作失败！", "消息", "error");
	  					}
	  				}, "json")
	  		} */
			
	</script>
</body>
</html>